<?php

require_once(sfConfig::get('sf_lib_dir').'/filter/base/BaseFormFilterPropel.class.php');

/**
 * User filter form base class.
 *
 * @package    FinalsClub
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormFilterGeneratedTemplate.php 13459 2008-11-28 14:48:12Z fabien $
 */
class BaseUserFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'email'                 => new sfWidgetFormFilterInput(),
      'first_name'            => new sfWidgetFormFilterInput(),
      'last_name'             => new sfWidgetFormFilterInput(),
      'username'              => new sfWidgetFormFilterInput(),
      'md5_password'          => new sfWidgetFormFilterInput(),
      'language'              => new sfWidgetFormFilterInput(),
      'country'               => new sfWidgetFormFilterInput(),
      'avatar'                => new sfWidgetFormFilterInput(),
      'gender'                => new sfWidgetFormFilterInput(),
      'birthdate'             => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => true)),
      'network_id'            => new sfWidgetFormFilterInput(),
      'network_name'          => new sfWidgetFormFilterInput(),
      'standing'              => new sfWidgetFormFilterInput(),
      'timezone'              => new sfWidgetFormFilterInput(),
      'tos_agreement'         => new sfWidgetFormFilterInput(),
      'receive_email_updates' => new sfWidgetFormFilterInput(),
      'copyright_agreement'   => new sfWidgetFormFilterInput(),
      'admin'                 => new sfWidgetFormFilterInput(),
      'created_at'            => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => true)),
      'updated_at'            => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => true)),
      'last_login_at'         => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => true)),
      'activated'             => new sfWidgetFormFilterInput(),
      'facebook_id'           => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'email'                 => new sfValidatorPass(array('required' => false)),
      'first_name'            => new sfValidatorPass(array('required' => false)),
      'last_name'             => new sfValidatorPass(array('required' => false)),
      'username'              => new sfValidatorPass(array('required' => false)),
      'md5_password'          => new sfValidatorPass(array('required' => false)),
      'language'              => new sfValidatorPass(array('required' => false)),
      'country'               => new sfValidatorPass(array('required' => false)),
      'avatar'                => new sfValidatorPass(array('required' => false)),
      'gender'                => new sfValidatorPass(array('required' => false)),
      'birthdate'             => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'network_id'            => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'network_name'          => new sfValidatorPass(array('required' => false)),
      'standing'              => new sfValidatorPass(array('required' => false)),
      'timezone'              => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'tos_agreement'         => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'receive_email_updates' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'copyright_agreement'   => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'admin'                 => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'created_at'            => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'updated_at'            => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'last_login_at'         => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'activated'             => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'facebook_id'           => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
    ));

    $this->widgetSchema->setNameFormat('user_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'User';
  }

  public function getFields()
  {
    return array(
      'id'                    => 'Number',
      'email'                 => 'Text',
      'first_name'            => 'Text',
      'last_name'             => 'Text',
      'username'              => 'Text',
      'md5_password'          => 'Text',
      'language'              => 'Text',
      'country'               => 'Text',
      'avatar'                => 'Text',
      'gender'                => 'Text',
      'birthdate'             => 'Date',
      'network_id'            => 'Number',
      'network_name'          => 'Text',
      'standing'              => 'Text',
      'timezone'              => 'Number',
      'tos_agreement'         => 'Number',
      'receive_email_updates' => 'Number',
      'copyright_agreement'   => 'Number',
      'admin'                 => 'Number',
      'created_at'            => 'Date',
      'updated_at'            => 'Date',
      'last_login_at'         => 'Date',
      'activated'             => 'Number',
      'facebook_id'           => 'Number',
    );
  }
}
